import { IWonewSer } from '@/typing'
import { NestExpressApplication } from '@nestjs/platform-express'

class GlobalService {
  private _app: NestExpressApplication | undefined = undefined
  private _appUrl: string = ""
  private _runnig_ffmpeg_ids: string[] = []
  private _server_sleep = "0"
  store: {[prop: string]: any} = {
    getPubVideoQueue: []
  }
  get app(): NestExpressApplication {
    return this._app
  }
  set app(app: NestExpressApplication) {
    this._app = app
  }

  get appUrl(): string {
    return this._appUrl
  }
  set appUrl(url: string) {
    this._appUrl = url
  }

  get runningFfmpegIds() {
    return this._runnig_ffmpeg_ids
  }
  set runningFfmpegIds(id: string[]) {
    this._runnig_ffmpeg_ids = id
  }

  bindAccountTaskSet: {[prop: string]: IWonewSer.BindAccountTask} = {}
  
}

const IGlobal = new GlobalService()

export default IGlobal